/*******************************************************************/
/* @ All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.        */
/*                                                                 */
/*  NAME      = t_wtc_mar_roundup4.c                               */
/*  NOTE      =                                                    */
/*  DATE      = 2016/02/25 by songbb                               */
/*******************************************************************/

#include <CUnit/Basic.h>
#include <stdlib.h>

#include "frcomm.h"

#include "../../../src/module/tuxedowtc/config.h"
#include <tuxedowtc/wtc_core.h>
#include <tuxedowtc/wtc_mar.h>

static int __suite_init(void)
{
    return 0;
}

static int __suite_cleanup(void)
{
    return 0;
}

static void __case1(void)
{
    CU_ASSERT_EQUAL(wtc_mar_roundup4(0), 0);
}

static void __case2(void)
{
    CU_ASSERT_EQUAL(wtc_mar_roundup4(1), 4);
}

static void __case3(void)
{
    CU_ASSERT_EQUAL(wtc_mar_roundup4(2), 4);
}

static void __case4(void)
{
    CU_ASSERT_EQUAL(wtc_mar_roundup4(3), 4);
}

static void __case5(void)
{
    CU_ASSERT_EQUAL(wtc_mar_roundup4(4), 4);
}

static void __case6(void)
{
    CU_ASSERT_EQUAL(wtc_mar_roundup4(5), 8);
}

int add_suite_wtc_mar_roundup4(void)
{
    CU_pSuite pSuite = NULL;

    if ((pSuite = CU_add_suite(MODULE_NAME" wtc_mar_roundup4()", __suite_init, __suite_cleanup)) == NULL)
        return FR_FAIL;

    if (CU_add_test(pSuite, "case1", __case1) == NULL ||
        CU_add_test(pSuite, "case2", __case2) == NULL ||
        CU_add_test(pSuite, "case3", __case3) == NULL ||
        CU_add_test(pSuite, "case4", __case4) == NULL ||
        CU_add_test(pSuite, "case5", __case5) == NULL ||
        CU_add_test(pSuite, "case6", __case6) == NULL)
        return FR_FAIL;

    return FR_SUCC;
}
